package top.chengdongqing.mishop.product.vo

import top.chengdongqing.mishop.product.projection.RecommendedProduct
import java.io.Serializable
import java.math.BigDecimal

data class RecommendedProductVO(
    val productId: Int,
    val productName: String,
    val skuId: Int,
    val skuName: String,
    val pictureUrl: String,
    val price: BigDecimal,
    val originalPrice: BigDecimal?,
    val limits: Int?,
    val reviews: Int
) : Serializable {
    companion object {
        fun of(product: RecommendedProduct): RecommendedProductVO {
            return RecommendedProductVO(
                product.productId,
                product.productName,
                product.skuId,
                product.skuName,
                product.pictureUrl,
                product.price,
                product.originalPrice,
                product.limits,
                product.reviews
            )
        }
    }
}
